import unittest


# 解析测试用例文件
# 返回数据格式为[(向量1, 向量2, 预期结果), ...]
def parse_test_case():
    with open("test_cases.csv") as f:
        cases = []
        lines = f.readlines()[1:]  # Skip header
        for line_data in lines:
            # print(line_data)
            vector1 = [
                float(p.strip(" ")) for p in line_data.split("|")[1][1:-1].split(",")
            ]
            vector2 = [
                float(p.strip(" ")) for p in line_data.split("|")[2][1:-1].split(",")
            ]
            expected = line_data.split("|")[3].strip()
            cases.append((vector1, vector2, expected))
        return cases


def cosine_similarity(vector1, vector2):
    pass


class TestCosineSimilarity(unittest.TestCase):
    pass


if __name__ == "__main__":
    pass
